<template>
  <div>
    <div class="panel-top">
      <a-row :gutter="24">
        <a-col :span="8" v-for="(item, idx) in panelList" :key="idx">
          <div class="panel-item" :style="{ color: item.color }">
            <div class="left">
              <component :is="item.icon" class="icon" />
              <div class="name">{{ item.name }}</div>
            </div>
            <div class="right">
              <div>
                当日：<span class="data">{{ item.today }} </span>
                {{ item.unit }}
              </div>
              <div>
                总数：<span class="data">{{ item.total }} </span>
                {{ item.unit }}
              </div>
            </div>
          </div>
        </a-col>
      </a-row>
    </div>
    <a-row :gutter="24">
      <a-col :span="10"> <div id="order"></div></a-col>
      <a-col :span="12"> <div id=""></div></a-col>
    </a-row>
    <div></div>
  </div>
</template>

<script setup>
import * as echarts from "echarts"
import { ref } from "vue"
const panelList = ref([
  {
    color: "#ffaa00",
    icon: "dollar-outlined",
    name: "销售额",
    today: 368.9,
    total: 7248.8,
    unit: "元",
  },
  {
    color: "#1890FF",
    icon: "shopping-cart-outlined",
    name: "订单量",
    today: 16,
    total: 544,
    unit: "单",
  },
  {
    color: "#52C41A",
    icon: "team-outlined",
    name: "用户量",
    today: 3,
    total: 982,
    unit: "人",
  },
])
</script>

<style lang="less" scoped>
.panel-top {
  margin: 24px;
  .panel-item {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 18px;

    .left {
      display: flex;
      flex-direction: row;
      align-items: center;
      .name {
        margin-left: 8px;
      }
      .icon {
        font-size: 40px;
      }
    }
    .right {
      text-align: right;
      .data {
        font-weight: 600;
      }
    }
  }
}
</style>
